package 进阶.File类.获取;

import java.io.File;

public class demo02 {
    public static void main(String[] args) {
        show1();

    }

    private static void show1() {
        File f = new File("D:\\");
        File[] files = f.listFiles();
        assert files != null;
        for (File file: files
             ) {
            System.out.println(file);
        }
    }

    private static void show() {
        File f = new File("D:\\");
        String[] list = f.list();
        assert list != null;
        for(String str : list){
            System.out.println(str);
        }
    }
}
